import mockRequest from '@/utils/mockRequest'

export interface KingKongData {
    picUrl:string,
    schemeUrl:string,
    text:string,
    textColor:string
}
export type KingKongListData = KingKongData[]

export interface IndexActivityData {
    picUrl:string,
    activityPrice:string,
    subTitle:string,
    originPrice:string,
    tag:string,
    title: string,
    targetUrl:string,
    showPicUrl:string
    id?:number
}
export type IndexActivityModuleData = IndexActivityData[]

interface CategoryData{
    picUrl:string,
    categoryName:string,
    categoryId?:string,
    targetUrl:string,
    navName:string
}
export type CategoryListData = CategoryData[]

interface policyDesc {
    icon: string,
    schemeUrl:string,
    desc: string
}
export type policyDescListData = policyDesc[]

interface ItemData {
    primarySkuPreSellStatus: number,
    picUrl: string,
    pieceUnitDesc:string,
    pieceNum: number,
    colorNum: number,
    schemeUrl: string,
    primarySkuPreSellPrice: number,
    id: number
}
export type ItemListData = ItemData[]

export type FloorListData = {
    itemList:ItemListData,
    cell:ItemListData
}

interface swiperData {
    id:string,
    picUrl:string
}
export type SwiperListData = swiperData[]

export type homeInfo = {
    kingKongList:KingKongListData,
    indexActivityModule:IndexActivityModuleData,
    categoryList:CategoryListData,
    title:string,
    policyDescList:policyDescListData,
    floorList:FloorListData,
    swiperList:SwiperListData,
    goodsList:GoodsListData
}

interface BannerData {
    logo?: string,
    title?: string,
    price?: string,
    content?:string
}

interface FinalPriceData {
    prefix?:string,
    price?: string,
    suffix?: string
}

type PriceInfoData = {
    finalPrice:FinalPriceData
    counterPrice: string,
    basicPrice: string
}
type FinalPriceInfoVOData = {
    banner:BannerData,
    priceInfo:PriceInfoData
}

export interface ItemTagData {
    name:string
}

export type ItemTagListData =ItemTagData[]

interface TopLogoData {
    logoUrl:string
}
interface PreLogoData {
    logoUrl:string
}
type PreLogoListData = PreLogoData[]

export type goodsData = {
    id:number,
    listPicUrl: string,
    name:string,
    finalPriceInfoVO:FinalPriceInfoVOData,
    topLogo:TopLogoData,
    preLogo:PreLogoListData,
    itemTagList?:ItemTagListData
}
export type GoodsListData = goodsData[]

type HomeInfoData = {
    code:number,
    data:homeInfo
}

type HomeInfoListData = {
    data:HomeInfoData
}

export default{
    getKingkongList(){
        return mockRequest.get<any,HomeInfoListData>('/homeInfo');
    }
}